package com.retrofit.library.callback;

import com.retrofit.library.entity.ListEntity;

import java.util.List;

/**
 * desc:
 * 2018-05-24 16:43
 */
abstract public class EntityListReqCallback<T> extends RespCallback<ListEntity<T>> {
    @Override
    public void onSuccess(ListEntity<T> tList) {
        if (tList.getCode().equals("0000")) {
            parseData(tList.getData());
        } else {
            onError(tList.getCode(), tList.getMsg());
        }
    }

    protected abstract void parseData(List<T> data);

}
